﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace T12OOP
{
    class GameValue
    {
        private int hp;//生命值
        private int mp;//魔法值
        private int sp;//精力值

        public int Hp { get { return hp; } set { hp = value; } }
        public int Mp { get { return mp; } set { mp = value; } }
        public int Sp { get { return sp; } set { sp = value; } }

        public override string ToString()
        {
            return string.Format("生命值:{0}魔法值:{1}精力值:{2}", hp, mp, sp);
        }

        public static GameValue operator +(GameValue gv1, GameValue gv2)
         {
            GameValue _gv = new GameValue();
            _gv.hp=gv1.hp+gv2.hp;
            _gv.mp = gv1.mp + gv2.mp;
            _gv.sp = gv1.sp + gv2.sp;
            return _gv;
        }



            
    }
}
